package cn.hx.malluser.vo;

import cn.hx.malluser.entity.UmsMember;
import cn.hx.malluser.entity.UmsMemberLevel;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

public class UmsMemberVo implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;
    private String username;
    private String nickname;
    private String phone;
    private String password;
    private Integer gender;
    private Date birthday;
    private String job;
    /**头像*/
    private String icon;
    /**个性签名*/
    private String personalizedSignature;
    /**积分*/
    private Integer integration;
    /**成长值*/
    private Integer growth;

    /**等级*/
    private String level;

    public static UmsMemberVo init(UmsMember umsMember, UmsMemberLevel umsMemberLevel) {
        UmsMemberVo vo = new UmsMemberVo();
        BeanUtils.copyProperties(umsMember, vo);
        vo.setLevel(umsMemberLevel.getName());
        return vo;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getPersonalizedSignature() {
        return personalizedSignature;
    }

    public void setPersonalizedSignature(String personalizedSignature) {
        this.personalizedSignature = personalizedSignature;
    }

    public Integer getIntegration() {
        return integration;
    }

    public void setIntegration(Integer integration) {
        this.integration = integration;
    }

    public Integer getGrowth() {
        return growth;
    }

    public void setGrowth(Integer growth) {
        this.growth = growth;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    @Override
    public String toString() {
        return "UmsMemberVo{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", phone='" + phone + '\'' +
                ", password='" + password + '\'' +
                ", gender=" + gender +
                ", birthday=" + birthday +
                ", job='" + job + '\'' +
                ", icon='" + icon + '\'' +
                ", personalizedSignature='" + personalizedSignature + '\'' +
                ", integration=" + integration +
                ", growth=" + growth +
                ", level='" + level + '\'' +
                '}';
    }
}
